package com.company;

import com.company.strategy.type1.ConcreteStrategy1;
import com.company.strategy.type1.ConcreteStrategy2;
import com.company.strategy.type1.ConcreteStrategy3;
import com.company.strategy.type1.Context;

/**
 * 策略模式测试代码
 */
public class TestForStrategy1 {

    public static void main(String[] args) {
        Context context;

        //不同策略执行不同的算法
        //策略1执行算法1
        context = new Context(new ConcreteStrategy1());
        context.executeStrategy();

        //策略2执行算法2
        context = new Context(new ConcreteStrategy2());
        context.executeStrategy();

        //策略3执行算法3
        context = new Context(new ConcreteStrategy3());
        context.executeStrategy();
    }
}
